load("@fbcode//buck2:proto_defs.bzl", "proto_srcs", "rust_protobuf_library_prost_0134")
load("@fbcode//grpc_fb/codegen:buck_macros.bzl", "grpc_library")
load("@fbcode_macros//build_defs/lib:oss.bzl", "translate_target")

oncall("build_infra")

rust_protobuf_library_prost_0134(
    name = "buck2_forkserver_proto",
    srcs = glob(["src/**/*.rs"]),
    build_script = "build.rs",
    proto_srcs = ":buck2_forkserver_proto.proto",
    deps = [
        "fbsource//third-party/rust:derive_more",
        "fbsource//third-party/rust:prost-types-0-13-4",
        "//buck2/app/buck2_data:buck2_data",
        "//buck2/gazebo/gazebo:gazebo",
    ],
)

proto_srcs(
    name = "buck2_forkserver_proto.proto",
    srcs = ["forkserver.proto"],
    visibility = ["PUBLIC"],
    deps = [
        translate_target("//buck2/app/buck2_data:data_proto"),
    ],
)

grpc_library(
    name = "forkserver",
    srcs = [
        "forkserver.proto",
        "//buck2/app/buck2_data:data.proto",
        "//buck2/app/buck2_data:error.proto",
        "//buck2/app/buck2_host_sharing_proto:host_sharing_proto",
    ],
    languages = [
        "py",
    ],
)
